if(NOT SKBUILD)
  install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/MaterialX" DESTINATION "python" MESSAGE_NEVER)
  install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Scripts" DESTINATION "python" MESSAGE_NEVER)
endif()

if(SKBUILD)
  install(
    DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Scripts/"
    DESTINATION "${MATERIALX_PYTHON_FOLDER_NAME}/_scripts"
    PATTERN "README.md" EXCLUDE
  )
endif()

if(MATERIALX_INSTALL_PYTHON AND PYTHON_EXECUTABLE AND NOT SKBUILD)
  set(SETUP_PY "${CMAKE_INSTALL_PREFIX}/python/setup.py")
  configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in" "${SETUP_PY}")
  install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/python)")
endif()
